/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.navid.trafalgar.manager;

import com.navid.trafalgar.mod.counterclock.CounterClockGameModel;
import com.jme3.renderer.Camera;
import com.jme3.renderer.ViewPort;
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial.CullHint;
import com.navid.trafalgar.definition.GameDefinition;
import com.navid.trafalgar.model.AShipModel;
import com.navid.trafalgar.model.GameModel;
import java.util.Collection;

/**
 *
 * @author alberto
 */
public class GameStatus {

    private float time;
    private GameDefinition gameDefinition;
    private CounterClockGameModel millestoneGameModel;
    //Nodes
    private final Node gameNode = new Node("Model Node");
    private final Node gameGUINode = new Node("GUI Node");
    //InitStateListener
    private ViewPort viewPort;
    private ViewPort viewPortGUI;
    //InitStateListener
    private Camera camera;
    private Camera cameraGUI;

    public GameStatus() {
        gameNode.setCullHint(CullHint.Never);

        gameGUINode.setQueueBucket(Bucket.Gui);
        gameGUINode.setCullHint(CullHint.Never);
    }

    public float getTime() {
        return time;
    }

    public void setTime(float time) {
        this.time = time;
    }

    public GameDefinition getGameDefinition() {
        return gameDefinition;
    }

    public void setGameDefinition(GameDefinition gameDefinition) {
        this.gameDefinition = gameDefinition;
    }

    public void setGameModel(GameModel gameModel) {
        if (gameModel != null){
        this.millestoneGameModel = new CounterClockGameModel(gameModel);
        }else{
            this.millestoneGameModel = null;
        }
    }

    public CounterClockGameModel getMillestoneGameModel() {
        return millestoneGameModel;
    }

    public Node getGameNode() {
        return gameNode;
    }

    public ViewPort getViewPort() {
        return viewPort;
    }

    public void setViewPort(ViewPort viewPort) {
        this.viewPort = viewPort;
    }

    public Camera getCamera() {
        return camera;
    }

    public void setCamera(Camera camera) {
        this.camera = camera;
    }

    public AShipModel getPlayerNode() {
        return this.millestoneGameModel.getShip();
    }

    public Node getGameGUINode() {
        return gameGUINode;
    }

    public Collection<? extends Node> getTargetsNode() {
        return this.getMillestoneGameModel().getMillestones().values();
    }

    public void setCameraGUI(Camera cameraGUI) {
        this.cameraGUI = cameraGUI;
    }

    public void setViewPortGUI(ViewPort viewPortGUI) {
        this.viewPortGUI = viewPortGUI;
    }
}
